<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>

</head>
<body>
    <!-- 本节主要是method的可以写函数特性，传参进行值的传递 -->
        <!-- 可以使用剩余参数传递多个值 -->
    <!-- 使用$event获取  目标元素 ，  -->
    <div id="app">
        {{count}}
        <button @click="fn1('abc')">按钮1</button>
        <button @click="fn2(1,2,3,'abc','def')">按钮2</button>
        <button @click="fn3(1,$event)">按钮3</button>
    </div>

    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
               return {
                    count:20,
                    
                }
            },
            methods: {
                fn1(e){
                    console.log(e)
                },
                fn2(a,b,...args){
                    console.log(a,b,...args)
                },
                fn3(a,e){
                    console.log(a,e)
                }
            },
        })


    </script>
</body>
</html>